package com.imooc.web.lock;

import org.apache.curator.framework.CuratorFramework;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class zkCurator {

    private CuratorFramework client;

    final static Logger log = LoggerFactory.getLogger(zkCurator.class);

    public zkCurator(CuratorFramework client){
        this.client = client;
    }

    /**
     * 进行初始化操作
     */
    public void init(){
        client.usingNamespace("zk-curator-connector");
    }

    /**
     * 判断zk是否连接
     */
    public boolean isAlive(){
        return client.isStarted();
    }
}
